package com.wlyuan.open.api;

import com.wlyuan.open.OpenBaseSyncDTO;
import com.wlyuan.open.dto.OpenSearchSourceDataDTO;

import java.util.List;

/**
 * @author lijing
 * @Description
 */
public interface IOpenSyncService {
    /**
     * 同步数据
     *
     * @param source 源数据
     * @param <T>
     */
    <T extends OpenBaseSyncDTO> void sync(T source);

    /**
     * 源数据同步成功
     *
     * @param sourceKey sourceKey
     */
    void sourceDataSuccess(String sourceKey);

    /**
     * 源数据同步失败
     *
     * @param sourceKey sourceKey
     * @param remark    失败原因
     */
    void sourceDataFail(String sourceKey, String remark);

    /**
     * 获取失败
     *
     * @param search
     * @return
     */
    List<String> getFailSourceData(OpenSearchSourceDataDTO search);
}
